#!/usr/local/bin/python3.8
import json
if __name__ == '__main__':
    # 不同的题型使用不同的策略
    with open('database.json', 'r') as f:
        database = json.loads(f.read())
    print(f"读取完成!共有{len(database)}条记录")
    while True:
        words_list = input().split(" ")
        # 直接5字母查询
        for k in database.keys():
            if words_list[0] in k:
                print(f"**************单词:{k}***************")
                mem = set()
                for item in database[k]:
                    for item1 in item['content']['usage']:
                        # 这里按照字母顺序打印
                        for word in item1.split(" "):
                            if '{' in word:
                                continue
                            mem.add(word)
                for ind, kw in enumerate(words_list[1:]):
                    for sc in mem:
                        if sc.startswith(kw):
                            print(f"{sc} - {kw} - {ind + 1}")
                        